3.1.28 \(\int (a+b \tan (c+d \sqrt {x})) \, dx\) [28]

Optimal. Leaf size=66 \[ a x+i b x-\frac {2 b \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {i b \text {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2} \]

[Out]

a*x+I*b*x+I*b*polylog(2,-exp(2*I*(c+d*x^(1/2))))/d^2-2*b*ln(1+exp(2*I*(c+d*x^(1/2))))*x^(1/2)/d

________________________________________________________________________________________

Rubi [A]
time = 0.07, antiderivative size = 66, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, integrand size = 14, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.357, Rules used = {3824, 3800, 2221, 2317, 2438} \begin {gather*} a x+\frac {i b \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}-\frac {2 b \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+i b x \end {gather*}

Antiderivative was successfully verified.

[In]

Int[a + b*Tan[c + d*Sqrt[x]],x]

[Out]

a*x + I*b*x - (2*b*Sqrt[x]*Log[1 + E^((2*I)*(c + d*Sqrt[x]))])/d + (I*b*PolyLog[2, -E^((2*I)*(c + d*Sqrt[x]))]
)/d^2

Rule 2221

Int[(((F_)^((g_.)*((e_.) + (f_.)*(x_))))^(n_.)*((c_.) + (d_.)*(x_))^(m_.))/((a_) + (b_.)*((F_)^((g_.)*((e_.) +
 (f_.)*(x_))))^(n_.)), x_Symbol] :> Simp[((c + d*x)^m/(b*f*g*n*Log[F]))*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x]
 - Dist[d*(m/(b*f*g*n*Log[F])), Int[(c + d*x)^(m - 1)*Log[1 + b*((F^(g*(e + f*x)))^n/a)], x], x] /; FreeQ[{F,
a, b, c, d, e, f, g, n}, x] && IGtQ[m, 0]

Rule 2317

Int[Log[(a_) + (b_.)*((F_)^((e_.)*((c_.) + (d_.)*(x_))))^(n_.)], x_Symbol] :> Dist[1/(d*e*n*Log[F]), Subst[Int
[Log[a + b*x]/x, x], x, (F^(e*(c + d*x)))^n], x] /; FreeQ[{F, a, b, c, d, e, n}, x] && GtQ[a, 0]

Rule 2438

Int[Log[(c_.)*((d_) + (e_.)*(x_)^(n_.))]/(x_), x_Symbol] :> Simp[-PolyLog[2, (-c)*e*x^n]/n, x] /; FreeQ[{c, d,
 e, n}, x] && EqQ[c*d, 1]

Rule 3800

Int[((c_.) + (d_.)*(x_))^(m_.)*tan[(e_.) + (f_.)*(x_)], x_Symbol] :> Simp[I*((c + d*x)^(m + 1)/(d*(m + 1))), x
] - Dist[2*I, Int[(c + d*x)^m*(E^(2*I*(e + f*x))/(1 + E^(2*I*(e + f*x)))), x], x] /; FreeQ[{c, d, e, f}, x] &&
 IGtQ[m, 0]

Rule 3824

Int[((a_.) + (b_.)*Tan[(c_.) + (d_.)*(x_)^(n_)])^(p_.), x_Symbol] :> Dist[1/n, Subst[Int[x^(1/n - 1)*(a + b*Ta
n[c + d*x])^p, x], x, x^n], x] /; FreeQ[{a, b, c, d, p}, x] && IGtQ[1/n, 0] && IntegerQ[p]

Rubi steps

\begin {align*} \int \left (a+b \tan \left (c+d \sqrt {x}\right )\right ) \, dx &=a x+b \int \tan \left (c+d \sqrt {x}\right ) \, dx\\ &=a x+(2 b) \text {Subst}\left (\int x \tan (c+d x) \, dx,x,\sqrt {x}\right )\\ &=a x+i b x-(4 i b) \text {Subst}\left (\int \frac {e^{2 i (c+d x)} x}{1+e^{2 i (c+d x)}} \, dx,x,\sqrt {x}\right )\\ &=a x+i b x-\frac {2 b \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {(2 b) \text {Subst}\left (\int \log \left (1+e^{2 i (c+d x)}\right ) \, dx,x,\sqrt {x}\right )}{d}\\ &=a x+i b x-\frac {2 b \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}-\frac {(i b) \text {Subst}\left (\int \frac {\log (1+x)}{x} \, dx,x,e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}\\ &=a x+i b x-\frac {2 b \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {i b \text {Li}_2\left (-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.03, size = 66, normalized size = 1.00 \begin {gather*} a x+i b x-\frac {2 b \sqrt {x} \log \left (1+e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d}+\frac {i b \text {PolyLog}\left (2,-e^{2 i \left (c+d \sqrt {x}\right )}\right )}{d^2} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[a + b*Tan[c + d*Sqrt[x]],x]

[Out]

a*x + I*b*x - (2*b*Sqrt[x]*Log[1 + E^((2*I)*(c + d*Sqrt[x]))])/d + (I*b*PolyLog[2, -E^((2*I)*(c + d*Sqrt[x]))]
)/d^2

________________________________________________________________________________________

Maple [F]
time = 0.39, size = 0, normalized size = 0.00 \[\int a +b \tan \left (c +d \sqrt {x}\right )\, dx\]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a+b*tan(c+d*x^(1/2)),x)

[Out]

int(a+b*tan(c+d*x^(1/2)),x)

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(c+d*x^(1/2)),x, algorithm="maxima")

[Out]

a*x + 2*b*integrate(sin(2*d*sqrt(x) + 2*c)/(cos(2*d*sqrt(x) + 2*c)^2 + sin(2*d*sqrt(x) + 2*c)^2 + 2*cos(2*d*sq
rt(x) + 2*c) + 1), x)

________________________________________________________________________________________

Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 153 vs. \(2 (51) = 102\).
time = 0.38, size = 153, normalized size = 2.32 \begin {gather*} \frac {2 \, a d^{2} x - 2 \, b d \sqrt {x} \log \left (-\frac {2 \, {\left (i \, \tan \left (d \sqrt {x} + c\right ) - 1\right )}}{\tan \left (d \sqrt {x} + c\right )^{2} + 1}\right ) - 2 \, b d \sqrt {x} \log \left (-\frac {2 \, {\left (-i \, \tan \left (d \sqrt {x} + c\right ) - 1\right )}}{\tan \left (d \sqrt {x} + c\right )^{2} + 1}\right ) - i \, b {\rm Li}_2\left (\frac {2 \, {\left (i \, \tan \left (d \sqrt {x} + c\right ) - 1\right )}}{\tan \left (d \sqrt {x} + c\right )^{2} + 1} + 1\right ) + i \, b {\rm Li}_2\left (\frac {2 \, {\left (-i \, \tan \left (d \sqrt {x} + c\right ) - 1\right )}}{\tan \left (d \sqrt {x} + c\right )^{2} + 1} + 1\right )}{2 \, d^{2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(c+d*x^(1/2)),x, algorithm="fricas")

[Out]

1/2*(2*a*d^2*x - 2*b*d*sqrt(x)*log(-2*(I*tan(d*sqrt(x) + c) - 1)/(tan(d*sqrt(x) + c)^2 + 1)) - 2*b*d*sqrt(x)*l
og(-2*(-I*tan(d*sqrt(x) + c) - 1)/(tan(d*sqrt(x) + c)^2 + 1)) - I*b*dilog(2*(I*tan(d*sqrt(x) + c) - 1)/(tan(d*
sqrt(x) + c)^2 + 1) + 1) + I*b*dilog(2*(-I*tan(d*sqrt(x) + c) - 1)/(tan(d*sqrt(x) + c)^2 + 1) + 1))/d^2

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \tan {\left (c + d \sqrt {x} \right )}\right )\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(c+d*x**(1/2)),x)

[Out]

Integral(a + b*tan(c + d*sqrt(x)), x)

________________________________________________________________________________________

Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(a+b*tan(c+d*x^(1/2)),x, algorithm="giac")

[Out]

integrate(b*tan(d*sqrt(x) + c) + a, x)

________________________________________________________________________________________

Mupad [B]
time = 3.59, size = 150, normalized size = 2.27 \begin {gather*} a\,x-\frac {b\,\left (\pi \,\ln \left (\cos \left (d\,\sqrt {x}\right )\right )+2\,c\,\ln \left ({\mathrm {e}}^{-d\,\sqrt {x}\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+1\right )-\pi \,\ln \left ({\mathrm {e}}^{-d\,\sqrt {x}\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+1\right )-\ln \left (\cos \left (c+d\,\sqrt {x}\right )\right )\,\left (2\,c-\pi \right )-\pi \,\ln \left ({\mathrm {e}}^{d\,\sqrt {x}\,2{}\mathrm {i}}+1\right )+d^2\,x\,1{}\mathrm {i}+\mathrm {polylog}\left (2,-{\mathrm {e}}^{-d\,\sqrt {x}\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}\right )\,1{}\mathrm {i}+2\,d\,\sqrt {x}\,\ln \left ({\mathrm {e}}^{-d\,\sqrt {x}\,2{}\mathrm {i}}\,{\mathrm {e}}^{-c\,2{}\mathrm {i}}+1\right )+c\,d\,\sqrt {x}\,2{}\mathrm {i}\right )}{d^2} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(a + b*tan(c + d*x^(1/2)),x)

[Out]

a*x - (b*(2*c*log(exp(-d*x^(1/2)*2i)*exp(-c*2i) + 1) - pi*log(exp(-d*x^(1/2)*2i)*exp(-c*2i) + 1) + pi*log(cos(
d*x^(1/2))) - log(cos(c + d*x^(1/2)))*(2*c - pi) - pi*log(exp(d*x^(1/2)*2i) + 1) + d^2*x*1i + polylog(2, -exp(
-d*x^(1/2)*2i)*exp(-c*2i))*1i + 2*d*x^(1/2)*log(exp(-d*x^(1/2)*2i)*exp(-c*2i) + 1) + c*d*x^(1/2)*2i))/d^2

________________________________________________________________________________________